package org.creativor.rayson.transport.client;

import static org.junit.Assert.assertNotNull;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import org.creativor.rayson.api.TransferArgument;
import org.creativor.rayson.api.TransferSocket;
import org.creativor.rayson.client.ClientCall;
import org.creativor.rayson.demo.proxy.DemoTransferArgument;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/**
 * The class <code>RpcConnectorTest</code> contains tests for the class
 * <code>{@link RpcConnector}</code>.
 * <p>
 * Copyright Creativor Studio (c) 2011
 * 
 * @generatedBy CodePro at 11-5-7 上午2:57
 * @author Nick Zhang
 * @version $Revision: 1.0 $
 */
public class RpcConnectorTest {
	/**
	 * Launch the test.
	 * 
	 * @param args
	 *            the command line arguments
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:57
	 */
	public static void main(String[] args) {
		new org.junit.runner.JUnitCore().run(RpcConnectorTest.class);
	}

	/**
	 * Perform pre-test initialization.
	 * 
	 * @throws Exception
	 *             if the initialization fails for some reason
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:57
	 */
	@Before
	public void setUp() throws Exception {
		// TODO: add additional set up code here
	}

	/**
	 * Perform post-test clean-up.
	 * 
	 * @throws Exception
	 *             if the clean-up fails for some reason
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:57
	 */
	@After
	public void tearDown() throws Exception {
		// TODO: add additional tear down code here
	}

	/**
	 * Run the void notifyConnectionClosed(RpcConnection) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:57
	 */
	@Test
	public void testNotifyConnectionClosed_1() throws Exception {
		RpcConnector fixture = new RpcConnector(TransportClient.getSingleton());
		RpcConnection connection = new RpcConnection(new InetSocketAddress(1),
				new PacketManager(), new Listener(new ConnectionManager()));

		fixture.notifyConnectionClosed(connection);

		// TODO: add additional test code here
	}

	/**
	 * Run the void notifyConnectionClosed(RpcConnection) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:57
	 */
	@Test
	public void testNotifyConnectionClosed_2() throws Exception {
		RpcConnector fixture = new RpcConnector(TransportClient.getSingleton());
		RpcConnection connection = new RpcConnection(new InetSocketAddress(1),
				new PacketManager(), new Listener(new ConnectionManager()));

		fixture.notifyConnectionClosed(connection);

		// TODO: add additional test code here
	}

	/**
	 * Run the void notifyConnectionClosed(RpcConnection) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:57
	 */
	@Test
	public void testNotifyConnectionClosed_3() throws Exception {
		RpcConnector fixture = new RpcConnector(TransportClient.getSingleton());
		RpcConnection connection = new RpcConnection(new InetSocketAddress(1),
				new PacketManager(), new Listener(new ConnectionManager()));

		fixture.notifyConnectionClosed(connection);

		// TODO: add additional test code here
	}

	/**
	 * Run the void notifyConnectionClosed(RpcConnection) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:57
	 */
	@Test
	public void testNotifyConnectionClosed_4() throws Exception {
		RpcConnector fixture = new RpcConnector(TransportClient.getSingleton());
		RpcConnection connection = new RpcConnection(new InetSocketAddress(1),
				new PacketManager(), new Listener(new ConnectionManager()));

		fixture.notifyConnectionClosed(connection);

		// TODO: add additional test code here
	}

	/**
	 * Run the TransferSocket openTransferSocket(SocketAddress,TransferArgument)
	 * method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:57
	 */
	@Test(expected = java.net.ConnectException.class)
	public void testOpenTransferSocket_1() throws Exception {
		RpcConnector fixture = new RpcConnector(TransportClient.getSingleton());
		SocketAddress serverAddress = new InetSocketAddress(1);
		TransferArgument argument = new DemoTransferArgument("");

		TransferSocket result = fixture.openTransferSocket(serverAddress,
				argument);

		// TODO: add additional test code here
		assertNotNull(result);
	}

	/**
	 * Run the TransferSocket openTransferSocket(SocketAddress,TransferArgument)
	 * method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:57
	 */
	@Test(expected = java.net.ConnectException.class)
	public void testOpenTransferSocket_2() throws Exception {
		RpcConnector fixture = new RpcConnector(TransportClient.getSingleton());
		SocketAddress serverAddress = new InetSocketAddress(1);
		TransferArgument argument = new DemoTransferArgument("");

		TransferSocket result = fixture.openTransferSocket(serverAddress,
				argument);

		// TODO: add additional test code here
		assertNotNull(result);
	}

	/**
	 * Run the TransferSocket openTransferSocket(SocketAddress,TransferArgument)
	 * method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:57
	 */
	@Test(expected = java.net.ConnectException.class)
	public void testOpenTransferSocket_3() throws Exception {
		RpcConnector fixture = new RpcConnector(TransportClient.getSingleton());
		SocketAddress serverAddress = new InetSocketAddress(1);
		TransferArgument argument = new DemoTransferArgument("");

		TransferSocket result = fixture.openTransferSocket(serverAddress,
				argument);

		// TODO: add additional test code here
		assertNotNull(result);
	}

	/**
	 * Run the TransferSocket openTransferSocket(SocketAddress,TransferArgument)
	 * method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:57
	 */
	@Test(expected = java.net.ConnectException.class)
	public void testOpenTransferSocket_4() throws Exception {
		RpcConnector fixture = new RpcConnector(TransportClient.getSingleton());
		SocketAddress serverAddress = new InetSocketAddress(1);
		TransferArgument argument = new DemoTransferArgument("");

		TransferSocket result = fixture.openTransferSocket(serverAddress,
				argument);

		// TODO: add additional test code here
		assertNotNull(result);
	}

	/**
	 * Run the TransferSocket openTransferSocket(SocketAddress,TransferArgument)
	 * method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:57
	 */
	@Test(expected = java.net.ConnectException.class)
	public void testOpenTransferSocket_5() throws Exception {
		RpcConnector fixture = new RpcConnector(TransportClient.getSingleton());
		SocketAddress serverAddress = new InetSocketAddress(1);
		TransferArgument argument = new DemoTransferArgument("");

		TransferSocket result = fixture.openTransferSocket(serverAddress,
				argument);

		// TODO: add additional test code here
		assertNotNull(result);
	}

	/**
	 * Run the TransferSocket openTransferSocket(SocketAddress,TransferArgument)
	 * method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:57
	 */
	@Test(expected = java.net.ConnectException.class)
	public void testOpenTransferSocket_6() throws Exception {
		RpcConnector fixture = new RpcConnector(TransportClient.getSingleton());
		SocketAddress serverAddress = new InetSocketAddress(1);
		TransferArgument argument = new DemoTransferArgument("");

		TransferSocket result = fixture.openTransferSocket(serverAddress,
				argument);

		// TODO: add additional test code here
		assertNotNull(result);
	}

	/**
	 * Run the void ping(SocketAddress) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:57
	 */
	@Test(expected = org.creativor.rayson.exception.NetWorkException.class)
	public void testPing_1() throws Exception {
		RpcConnector fixture = new RpcConnector(TransportClient.getSingleton());
		SocketAddress serverAddress = new InetSocketAddress(1);

		fixture.ping(serverAddress);

		// TODO: add additional test code here
	}

	/**
	 * Run the void ping(SocketAddress) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:57
	 */
	@Test(expected = org.creativor.rayson.exception.NetWorkException.class)
	public void testPing_2() throws Exception {
		RpcConnector fixture = new RpcConnector(TransportClient.getSingleton());
		SocketAddress serverAddress = new InetSocketAddress(1);

		fixture.ping(serverAddress);

		// TODO: add additional test code here
	}

	/**
	 * Run the void responseOneCall() method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:57
	 */
	@Test
	public void testResponseOneCall_1() throws Exception {
		RpcConnector fixture = new RpcConnector(TransportClient.getSingleton());

		fixture.responseOneCall();

		// TODO: add additional test code here
	}

	/**
	 * Run the void responseOneCall() method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:57
	 */
	@Test
	public void testResponseOneCall_2() throws Exception {
		RpcConnector fixture = new RpcConnector(TransportClient.getSingleton());

		fixture.responseOneCall();

		// TODO: add additional test code here
	}

	/**
	 * Run the void responseOneCall() method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:57
	 */
	@Test(expected = java.io.IOException.class)
	public void testResponseOneCall_3() throws Exception {
		RpcConnector fixture = new RpcConnector(TransportClient.getSingleton());

		fixture.responseOneCall();

		// TODO: add additional test code here
	}

	/**
	 * Run the void responseOneCall() method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:57
	 */
	@Test(expected = java.lang.InterruptedException.class)
	public void testResponseOneCall_4() throws Exception {
		RpcConnector fixture = new RpcConnector(TransportClient.getSingleton());

		fixture.responseOneCall();

		// TODO: add additional test code here
	}

	/**
	 * Run the RpcConnector(TransportClient) constructor test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:57
	 */
	@Test
	public void testRpcConnector_1() throws Exception {
		TransportClient client = TransportClient.getSingleton();

		RpcConnector result = new RpcConnector(client);

		// TODO: add additional test code here
		assertNotNull(result);
	}

	/**
	 * Run the void submitCall(SocketAddress,ClientCall) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:57
	 */
	@Test(expected = java.net.ConnectException.class)
	public void testSubmitCall_1() throws Exception {
		RpcConnector fixture = new RpcConnector(TransportClient.getSingleton());
		SocketAddress serverAddress = new InetSocketAddress(1);
		ClientCall call = null;

		fixture.submitCall(serverAddress, call);

		// TODO: add additional test code here
	}

	/**
	 * Run the void submitCall(SocketAddress,ClientCall) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:57
	 */
	@Test(expected = java.net.ConnectException.class)
	public void testSubmitCall_10() throws Exception {
		RpcConnector fixture = new RpcConnector(TransportClient.getSingleton());
		SocketAddress serverAddress = new InetSocketAddress(1);
		ClientCall call = null;

		fixture.submitCall(serverAddress, call);

		// TODO: add additional test code here
	}

	/**
	 * Run the void submitCall(SocketAddress,ClientCall) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:57
	 */
	@Test(expected = java.net.ConnectException.class)
	public void testSubmitCall_2() throws Exception {
		RpcConnector fixture = new RpcConnector(TransportClient.getSingleton());
		SocketAddress serverAddress = new InetSocketAddress(1);
		ClientCall call = null;

		fixture.submitCall(serverAddress, call);

		// TODO: add additional test code here
	}

	/**
	 * Run the void submitCall(SocketAddress,ClientCall) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:57
	 */
	@Test(expected = java.net.ConnectException.class)
	public void testSubmitCall_3() throws Exception {
		RpcConnector fixture = new RpcConnector(TransportClient.getSingleton());
		SocketAddress serverAddress = new InetSocketAddress(1);
		ClientCall call = null;

		fixture.submitCall(serverAddress, call);

		// TODO: add additional test code here
	}

	/**
	 * Run the void submitCall(SocketAddress,ClientCall) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:57
	 */
	@Test(expected = java.net.ConnectException.class)
	public void testSubmitCall_4() throws Exception {
		RpcConnector fixture = new RpcConnector(TransportClient.getSingleton());
		SocketAddress serverAddress = new InetSocketAddress(1);
		ClientCall call = null;

		fixture.submitCall(serverAddress, call);

		// TODO: add additional test code here
	}

	/**
	 * Run the void submitCall(SocketAddress,ClientCall) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:57
	 */
	@Test(expected = java.net.ConnectException.class)
	public void testSubmitCall_5() throws Exception {
		RpcConnector fixture = new RpcConnector(TransportClient.getSingleton());
		SocketAddress serverAddress = new InetSocketAddress(1);
		ClientCall call = null;

		fixture.submitCall(serverAddress, call);

		// TODO: add additional test code here
	}

	/**
	 * Run the void submitCall(SocketAddress,ClientCall) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:57
	 */
	@Test(expected = java.net.ConnectException.class)
	public void testSubmitCall_6() throws Exception {
		RpcConnector fixture = new RpcConnector(TransportClient.getSingleton());
		SocketAddress serverAddress = new InetSocketAddress(1);
		ClientCall call = null;

		fixture.submitCall(serverAddress, call);

		// TODO: add additional test code here
	}

	/**
	 * Run the void submitCall(SocketAddress,ClientCall) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:57
	 */
	@Test(expected = java.net.ConnectException.class)
	public void testSubmitCall_7() throws Exception {
		RpcConnector fixture = new RpcConnector(TransportClient.getSingleton());
		SocketAddress serverAddress = new InetSocketAddress(1);
		ClientCall call = null;

		fixture.submitCall(serverAddress, call);

		// TODO: add additional test code here
	}

	/**
	 * Run the void submitCall(SocketAddress,ClientCall) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:57
	 */
	@Test(expected = java.net.ConnectException.class)
	public void testSubmitCall_8() throws Exception {
		RpcConnector fixture = new RpcConnector(TransportClient.getSingleton());
		SocketAddress serverAddress = new InetSocketAddress(1);
		ClientCall call = null;

		fixture.submitCall(serverAddress, call);

		// TODO: add additional test code here
	}

	/**
	 * Run the void submitCall(SocketAddress,ClientCall) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:57
	 */
	@Test(expected = java.net.ConnectException.class)
	public void testSubmitCall_9() throws Exception {
		RpcConnector fixture = new RpcConnector(TransportClient.getSingleton());
		SocketAddress serverAddress = new InetSocketAddress(1);
		ClientCall call = null;

		fixture.submitCall(serverAddress, call);

		// TODO: add additional test code here
	}
}